package com.ruoyi.system.service.impl;

import java.util.Collection;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WeatherForecastMapper;
import com.ruoyi.system.domain.WeatherForecast;
import com.ruoyi.system.service.IWeatherForecastService;
import com.ruoyi.common.core.text.Convert;

/**
 * 天气预报Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-16
 */
@Service
public class WeatherForecastServiceImpl implements IWeatherForecastService
{
    @Autowired
    private WeatherForecastMapper weatherForecastMapper;

    /**
     * 查询天气预报
     *
     * @param id 天气预报主键
     * @return 天气预报
     */
    @Override
    public WeatherForecast selectWeatherForecastById(Long id)
    {
        return weatherForecastMapper.selectWeatherForecastById(id);
    }

    /**
     * 查询天气预报列表
     *
     * @param weatherForecast 天气预报
     * @return 天气预报
     */
    @Override
    public List<WeatherForecast> selectWeatherForecastList(WeatherForecast weatherForecast)
    {
        return weatherForecastMapper.selectWeatherForecastList(weatherForecast);
    }

    /**
     * 新增天气预报
     *
     * @param weatherForecast 天气预报
     * @return 结果
     */
    @Override
    public int insertWeatherForecast(WeatherForecast weatherForecast)
    {
        return weatherForecastMapper.insertWeatherForecast(weatherForecast);
    }

    /**
     * 修改天气预报
     *
     * @param weatherForecast 天气预报
     * @return 结果
     */
    @Override
    public int updateWeatherForecast(WeatherForecast weatherForecast)
    {
        return weatherForecastMapper.updateWeatherForecast(weatherForecast);
    }

    /**
     * 批量删除天气预报
     *
     * @param ids 需要删除的天气预报主键
     * @return 结果
     */
    @Override
    public int deleteWeatherForecastByIds(String ids)
    {
        return weatherForecastMapper.deleteWeatherForecastByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除天气预报信息
     *
     * @param id 天气预报主键
     * @return 结果
     */
    @Override
    public int deleteWeatherForecastById(Long id)
    {
        return weatherForecastMapper.deleteWeatherForecastById(id);
    }

    @Override
    public WeatherForecast selectWeatherForecastByDate(String date) {
        return weatherForecastMapper.selectWeatherForecastByDate(date);
    }

    @Override
    public List<WeatherForecast> getWeatherForecastSeven() {
        return weatherForecastMapper.getWeatherForecastSeven();
    }

}
